Optimal. Leaf size=182 \[ -\frac {(3 a-7 b) (a-b) \sqrt {b} \text {ArcTan}\left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{2 a^{9/2} f}-\frac {\left (5 a^2-20 a b+14 b^2\right ) \cot (e+f x)}{5 a^4 f}-\frac {(10 a-7 b) \cot ^3(e+f x)}{15 a^3 f}-\frac {\cot ^5(e+f x)}{5 a f \left (a+b \tan ^2(e+f x)\right )}-\frac {b \left (5 a^2-10 a b+7 b^2\right ) \tan (e+f x)}{10 a^4 f \left (a+b \tan ^2(e+f x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.16, antiderivative size = 182, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3744, 473, 467,
1275, 211} \begin {gather*} -\frac {\sqrt {b} (3 a-7 b) (a-b) \text {ArcTan}\left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{2 a^{9/2} f}-\frac {(10 a-7 b) \cot ^3(e+f x)}{15 a^3 f}-\frac {b \left (5 a^2-10 a b+7 b^2\right ) \tan (e+f x)}{10 a^4 f \left (a+b \tan ^2(e+f x)\right )}-\frac {\left (5 a^2-20 a b+14 b^2\right ) \cot (e+f x)}{5 a^4 f}-\frac {\cot ^5(e+f x)}{5 a f \left (a+b \tan ^2(e+f x)\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 467
Rule 473
Rule 1275
Rule 3744
Rubi steps
\begin {align*} \int \frac {\csc ^6(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx &=\frac {\text {Subst}\left (\int \frac {\left (1+x^2\right )^2}{x^6 \left (a+b x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {\cot ^5(e+f x)}{5 a f \left (a+b \tan ^2(e+f x)\right )}+\frac {\text {Subst}\left (\int \frac {10 a-7 b+5 a x^2}{x^4 \left (a+b x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{5 a f}\\ &=-\frac {\cot ^5(e+f x)}{5 a f \left (a+b \tan ^2(e+f x)\right )}-\frac {b \left (5 a^2-10 a b+7 b^2\right ) \tan (e+f x)}{10 a^4 f \left (a+b \tan ^2(e+f x)\right )}-\frac {b \text {Subst}\left (\int \frac {2 \left (\frac {7}{a}-\frac {10}{b}\right )+2 \left (\frac {10}{a}-\frac {5}{b}-\frac {7 b}{a^2}\right ) x^2+\frac {\left (5 a^2-10 a b+7 b^2\right ) x^4}{a^3}}{x^4 \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{10 a f}\\ &=-\frac {\cot ^5(e+f x)}{5 a f \left (a+b \tan ^2(e+f x)\right )}-\frac {b \left (5 a^2-10 a b+7 b^2\right ) \tan (e+f x)}{10 a^4 f \left (a+b \tan ^2(e+f x)\right )}-\frac {b \text {Subst}\left (\int \left (-\frac {2 (10 a-7 b)}{a^2 b x^4}-\frac {2 \left (5 a^2-20 a b+14 b^2\right )}{a^3 b x^2}+\frac {5 (3 a-7 b) (a-b)}{a^3 \left (a+b x^2\right )}\right ) \, dx,x,\tan (e+f x)\right )}{10 a f}\\ &=-\frac {\left (5 a^2-20 a b+14 b^2\right ) \cot (e+f x)}{5 a^4 f}-\frac {(10 a-7 b) \cot ^3(e+f x)}{15 a^3 f}-\frac {\cot ^5(e+f x)}{5 a f \left (a+b \tan ^2(e+f x)\right )}-\frac {b \left (5 a^2-10 a b+7 b^2\right ) \tan (e+f x)}{10 a^4 f \left (a+b \tan ^2(e+f x)\right )}-\frac {((3 a-7 b) (a-b) b) \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\tan (e+f x)\right )}{2 a^4 f}\\ &=-\frac {(3 a-7 b) (a-b) \sqrt {b} \tan ^{-1}\left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{2 a^{9/2} f}-\frac {\left (5 a^2-20 a b+14 b^2\right ) \cot (e+f x)}{5 a^4 f}-\frac {(10 a-7 b) \cot ^3(e+f x)}{15 a^3 f}-\frac {\cot ^5(e+f x)}{5 a f \left (a+b \tan ^2(e+f x)\right )}-\frac {b \left (5 a^2-10 a b+7 b^2\right ) \tan (e+f x)}{10 a^4 f \left (a+b \tan ^2(e+f x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.27, size = 151, normalized size = 0.83 \begin {gather*} \frac {-15 \sqrt {b} \left (3 a^2-10 a b+7 b^2\right ) \text {ArcTan}\left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )+\sqrt {a} \left (-2 \cot (e+f x) \left (8 a^2-50 a b+45 b^2+2 a (2 a-5 b) \csc ^2(e+f x)+3 a^2 \csc ^4(e+f x)\right )-\frac {15 (a-b)^2 b \sin (2 (e+f x))}{a+b+(a-b) \cos (2 (e+f x))}\right )}{30 a^{9/2} f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.36, size = 144, normalized size = 0.79
method | result | size |
derivativedivides | \(\frac {-\frac {1}{5 a^{2} \tan \left (f x +e \right )^{5}}-\frac {2 a -2 b}{3 a^{3} \tan \left (f x +e \right )^{3}}-\frac {a^{2}-4 a b +3 b^{2}}{a^{4} \tan \left (f x +e \right )}-\frac {b \left (\frac {\left (\frac {1}{2} a^{2}-a b +\frac {1}{2} b^{2}\right ) \tan \left (f x +e \right )}{a +b \left (\tan ^{2}\left (f x +e \right )\right )}+\frac {\left (3 a^{2}-10 a b +7 b^{2}\right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{2 \sqrt {a b}}\right )}{a^{4}}}{f}\) | \(144\) |
default | \(\frac {-\frac {1}{5 a^{2} \tan \left (f x +e \right )^{5}}-\frac {2 a -2 b}{3 a^{3} \tan \left (f x +e \right )^{3}}-\frac {a^{2}-4 a b +3 b^{2}}{a^{4} \tan \left (f x +e \right )}-\frac {b \left (\frac {\left (\frac {1}{2} a^{2}-a b +\frac {1}{2} b^{2}\right ) \tan \left (f x +e \right )}{a +b \left (\tan ^{2}\left (f x +e \right )\right )}+\frac {\left (3 a^{2}-10 a b +7 b^{2}\right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{2 \sqrt {a b}}\right )}{a^{4}}}{f}\) | \(144\) |
risch | \(\frac {i \left (105 b^{3}-240 a^{3} {\mathrm e}^{6 i \left (f x +e \right )}-2100 b^{3} {\mathrm e}^{6 i \left (f x +e \right )}-16 a^{3} {\mathrm e}^{4 i \left (f x +e \right )}+105 b^{3} {\mathrm e}^{12 i \left (f x +e \right )}+1575 b^{3} {\mathrm e}^{4 i \left (f x +e \right )}+48 a^{3} {\mathrm e}^{2 i \left (f x +e \right )}-630 b^{3} {\mathrm e}^{2 i \left (f x +e \right )}-630 b^{3} {\mathrm e}^{10 i \left (f x +e \right )}-160 a^{3} {\mathrm e}^{8 i \left (f x +e \right )}+1575 b^{3} {\mathrm e}^{8 i \left (f x +e \right )}-220 a \,b^{2}+131 a^{2} b -16 a^{3}+690 a \,b^{2} {\mathrm e}^{10 i \left (f x +e \right )}-1830 a \,b^{2} {\mathrm e}^{4 i \left (f x +e \right )}+2020 a \,b^{2} {\mathrm e}^{6 i \left (f x +e \right )}+80 a^{2} b \,{\mathrm e}^{6 i \left (f x +e \right )}+271 a^{2} b \,{\mathrm e}^{4 i \left (f x +e \right )}-180 a^{2} b \,{\mathrm e}^{10 i \left (f x +e \right )}+970 a \,b^{2} {\mathrm e}^{2 i \left (f x +e \right )}-150 a \,b^{2} {\mathrm e}^{12 i \left (f x +e \right )}-1480 a \,b^{2} {\mathrm e}^{8 i \left (f x +e \right )}-412 a^{2} b \,{\mathrm e}^{2 i \left (f x +e \right )}+65 a^{2} b \,{\mathrm e}^{8 i \left (f x +e \right )}+45 a^{2} b \,{\mathrm e}^{12 i \left (f x +e \right )}\right )}{15 f \,a^{4} \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{5} \left (a \,{\mathrm e}^{4 i \left (f x +e \right )}-b \,{\mathrm e}^{4 i \left (f x +e \right )}+2 a \,{\mathrm e}^{2 i \left (f x +e \right )}+2 b \,{\mathrm e}^{2 i \left (f x +e \right )}+a -b \right )}-\frac {3 \sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right )}{4 a^{3} f}+\frac {5 \sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right ) b}{2 a^{4} f}-\frac {7 \sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right ) b^{2}}{4 a^{5} f}+\frac {3 \sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right )}{4 a^{3} f}-\frac {5 \sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right ) b}{2 a^{4} f}+\frac {7 \sqrt {-a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right ) b^{2}}{4 a^{5} f}\) | \(714\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 167, normalized size = 0.92 \begin {gather*} -\frac {\frac {15 \, {\left (3 \, a^{2} b - 10 \, a b^{2} + 7 \, b^{3}\right )} \tan \left (f x + e\right )^{6} + 10 \, {\left (3 \, a^{3} - 10 \, a^{2} b + 7 \, a b^{2}\right )} \tan \left (f x + e\right )^{4} + 6 \, a^{3} + 2 \, {\left (10 \, a^{3} - 7 \, a^{2} b\right )} \tan \left (f x + e\right )^{2}}{a^{4} b \tan \left (f x + e\right )^{7} + a^{5} \tan \left (f x + e\right )^{5}} + \frac {15 \, {\left (3 \, a^{2} b - 10 \, a b^{2} + 7 \, b^{3}\right )} \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )}{\sqrt {a b} a^{4}}}{30 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 398 vs.
\(2 (171) = 342\).
time = 3.30, size = 889, normalized size = 4.88 \begin {gather*} \left [-\frac {4 \, {\left (16 \, a^{3} - 131 \, a^{2} b + 220 \, a b^{2} - 105 \, b^{3}\right )} \cos \left (f x + e\right )^{7} - 4 \, {\left (40 \, a^{3} - 321 \, a^{2} b + 590 \, a b^{2} - 315 \, b^{3}\right )} \cos \left (f x + e\right )^{5} + 20 \, {\left (6 \, a^{3} - 47 \, a^{2} b + 104 \, a b^{2} - 63 \, b^{3}\right )} \cos \left (f x + e\right )^{3} - 15 \, {\left ({\left (3 \, a^{3} - 13 \, a^{2} b + 17 \, a b^{2} - 7 \, b^{3}\right )} \cos \left (f x + e\right )^{6} - {\left (6 \, a^{3} - 29 \, a^{2} b + 44 \, a b^{2} - 21 \, b^{3}\right )} \cos \left (f x + e\right )^{4} + 3 \, a^{2} b - 10 \, a b^{2} + 7 \, b^{3} + {\left (3 \, a^{3} - 19 \, a^{2} b + 37 \, a b^{2} - 21 \, b^{3}\right )} \cos \left (f x + e\right )^{2}\right )} \sqrt {-\frac {b}{a}} \log \left (\frac {{\left (a^{2} + 6 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (3 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} + 4 \, {\left ({\left (a^{2} + a b\right )} \cos \left (f x + e\right )^{3} - a b \cos \left (f x + e\right )\right )} \sqrt {-\frac {b}{a}} \sin \left (f x + e\right ) + b^{2}}{{\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{4} + 2 \, {\left (a b - b^{2}\right )} \cos \left (f x + e\right )^{2} + b^{2}}\right ) \sin \left (f x + e\right ) + 60 \, {\left (3 \, a^{2} b - 10 \, a b^{2} + 7 \, b^{3}\right )} \cos \left (f x + e\right )}{120 \, {\left ({\left (a^{5} - a^{4} b\right )} f \cos \left (f x + e\right )^{6} + a^{4} b f - {\left (2 \, a^{5} - 3 \, a^{4} b\right )} f \cos \left (f x + e\right )^{4} + {\left (a^{5} - 3 \, a^{4} b\right )} f \cos \left (f x + e\right )^{2}\right )} \sin \left (f x + e\right )}, -\frac {2 \, {\left (16 \, a^{3} - 131 \, a^{2} b + 220 \, a b^{2} - 105 \, b^{3}\right )} \cos \left (f x + e\right )^{7} - 2 \, {\left (40 \, a^{3} - 321 \, a^{2} b + 590 \, a b^{2} - 315 \, b^{3}\right )} \cos \left (f x + e\right )^{5} + 10 \, {\left (6 \, a^{3} - 47 \, a^{2} b + 104 \, a b^{2} - 63 \, b^{3}\right )} \cos \left (f x + e\right )^{3} - 15 \, {\left ({\left (3 \, a^{3} - 13 \, a^{2} b + 17 \, a b^{2} - 7 \, b^{3}\right )} \cos \left (f x + e\right )^{6} - {\left (6 \, a^{3} - 29 \, a^{2} b + 44 \, a b^{2} - 21 \, b^{3}\right )} \cos \left (f x + e\right )^{4} + 3 \, a^{2} b - 10 \, a b^{2} + 7 \, b^{3} + {\left (3 \, a^{3} - 19 \, a^{2} b + 37 \, a b^{2} - 21 \, b^{3}\right )} \cos \left (f x + e\right )^{2}\right )} \sqrt {\frac {b}{a}} \arctan \left (\frac {{\left ({\left (a + b\right )} \cos \left (f x + e\right )^{2} - b\right )} \sqrt {\frac {b}{a}}}{2 \, b \cos \left (f x + e\right ) \sin \left (f x + e\right )}\right ) \sin \left (f x + e\right ) + 30 \, {\left (3 \, a^{2} b - 10 \, a b^{2} + 7 \, b^{3}\right )} \cos \left (f x + e\right )}{60 \, {\left ({\left (a^{5} - a^{4} b\right )} f \cos \left (f x + e\right )^{6} + a^{4} b f - {\left (2 \, a^{5} - 3 \, a^{4} b\right )} f \cos \left (f x + e\right )^{4} + {\left (a^{5} - 3 \, a^{4} b\right )} f \cos \left (f x + e\right )^{2}\right )} \sin \left (f x + e\right )}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.79, size = 212, normalized size = 1.16 \begin {gather*} -\frac {\frac {15 \, {\left (3 \, a^{2} b - 10 \, a b^{2} + 7 \, b^{3}\right )} {\left (\pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )\right )}}{\sqrt {a b} a^{4}} + \frac {15 \, {\left (a^{2} b \tan \left (f x + e\right ) - 2 \, a b^{2} \tan \left (f x + e\right ) + b^{3} \tan \left (f x + e\right )\right )}}{{\left (b \tan \left (f x + e\right )^{2} + a\right )} a^{4}} + \frac {2 \, {\left (15 \, a^{2} \tan \left (f x + e\right )^{4} - 60 \, a b \tan \left (f x + e\right )^{4} + 45 \, b^{2} \tan \left (f x + e\right )^{4} + 10 \, a^{2} \tan \left (f x + e\right )^{2} - 10 \, a b \tan \left (f x + e\right )^{2} + 3 \, a^{2}\right )}}{a^{4} \tan \left (f x + e\right )^{5}}}{30 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 12.37, size = 178, normalized size = 0.98 \begin {gather*} -\frac {\frac {1}{5\,a}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (3\,a^2-10\,a\,b+7\,b^2\right )}{3\,a^3}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (10\,a-7\,b\right )}{15\,a^2}+\frac {b\,{\mathrm {tan}\left (e+f\,x\right )}^6\,\left (3\,a^2-10\,a\,b+7\,b^2\right )}{2\,a^4}}{f\,\left (b\,{\mathrm {tan}\left (e+f\,x\right )}^7+a\,{\mathrm {tan}\left (e+f\,x\right )}^5\right )}-\frac {\sqrt {b}\,\mathrm {atan}\left (\frac {\sqrt {b}\,\mathrm {tan}\left (e+f\,x\right )\,\left (a-b\right )\,\left (3\,a-7\,b\right )}{\sqrt {a}\,\left (3\,a^2-10\,a\,b+7\,b^2\right )}\right )\,\left (a-b\right )\,\left (3\,a-7\,b\right )}{2\,a^{9/2}\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________